import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/',
    name: 'index',
    redirect: '/main'
  },
  {
    path: '/main',
    name: 'main',
    component: () => import('../views/Main.vue'),
    redirect: '/main/home',
    children: [
      {
        path: '/main/home',
        name: 'home',
        component: () => import('../views/HomeView.vue'),
      },
      {
        path: '/main/search',
        name: 'search',
        component: () => import('../views/SearchView.vue'),
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
